/*
 * Pair.cpp
 *
 *  Created on: 26/05/2010
 *      Author: prodrig
 */

#include "Pair.h"
#include <stdio.h>
#include <string>
#include <sstream>

using std::string;
using std::stringstream;

Pair::Pair() {
	key = 0;
	value = 0;
}
Pair::Pair(IKey *iKey, ICollectible *iCollectible) {
	key = iKey;
	value = iCollectible;
}

ICollectible *Pair::getValue() {
	return value;
}

IKey *Pair::getKey() {
	return key;
}

void Pair::setValue(ICollectible* val) {
	value = val;
}

bool Pair::same(ICollectible * pair){
	return this == pair;
}

string Pair::toString() {
	string sret;
	stringstream out;
	out << "(" << key->toString() << ", " << value->toString() << ")";
	sret = out.str();
	return sret;
}

Pair::~Pair() {

}
